package com.kevin.websocket.client.model.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 正文类型
 */
@Getter
@RequiredArgsConstructor
public enum ContentType {

    NONE("0"),
    TEXT("1"),
    FILE("2"),
    IMG("3"),
    VIDEO("4"),
    ;

    private final String value;

    public static ContentType valueOfVal(String value) {
        for (ContentType contentType : ContentType.values()) {
            if (contentType.getValue().equals(value)) {
                return contentType;
            }
        }
        throw new UnsupportedOperationException("Unsupported ContentType");
    }

}
